//
// Created by 田建昆 on 2020/12/11.
//

#include "sort.h"
#include <priority_queue.h>

void heap(int arr[], int size) {
    priority_queue *pq = priority_queue_create(size);
    for (int i = 0; i < size; ++i) {
        priority_queue_insert(pq, arr[i]);
    }

    for (int i = 0; i < size; ++i) {
        arr[i] = priority_queue_delmin(pq);
    }
}